import React, {useState} from "react";
import {
    BrowserRouter as Router,
    Switch,
    Route,
    Redirect,
} from "react-router-dom";
import {TransitionGroup, CSSTransition} from 'react-transition-group'
import Center from "../pages/center/center";
import Home from "../pages/home/home";
import Talk from "../pages/talk/talk";
import Login from "../pages/login/login";
import "../style/router.less";
import PageTransition from "react-router-page-transition";
import stores from "../store";

// function RouterCreate(props) {
//     return !props.login.isLogin ? <Redirect to="/login"/> : <Route path={props.path} component={props.component}/>
// }
const  routes = [
    {path: '/', name: 'Home', exact:true, Component: Home},
    {path: '/center', name: 'center', exact:false, Component: Center},
    {path: '/talk', name: 'talk', exact:false, Component: Talk},
    {path: '/login', name: 'login',  exact:false,Component: Login},
]
class router222 extends React.Component{
    constructor(props){
        super(props);
        this.state={
            show:true,
        }
    }
    render() {
        return (
                <Router>
                    <Route
                        render={({ location }) => (
                            <PageTransition timeout={500}>
                                <Switch location={location}>
                                    <Route exact path="/" component={Home} />
                                    {/* <Route path="/list" component={List}/> */}
                                    <Route path="/talk" component={Talk} />
                                </Switch>
                            </PageTransition>
                        )}
                    />
                </Router>
        )
    }


}

export default router222;
